package com.xbongbong.paas.service.workflow.setting.impl;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.enums.FieldTypeEnum;
import com.xbongbong.paas.pojo.workflow.settings.WorkflowGetPojo;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.constant.I18nStringConstant;
import com.xbongbong.workflow.pojo.nodes.WorkflowConditionPojo;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @author 吴峰
 * @date 2021/06/01 20:05
 */
@Service("conditionNodeCreatorDeptServiceImpl")
public class ConditionNodeCreatorDeptServiceImpl extends ConditionNodeDeptServiceImpl {



    @Override
    public List<Integer> type() {
        return Arrays.asList( FieldTypeEnum.CREATOR_DEPT.getType());
    }

    @Override
    public String conditionField(WorkflowConditionPojo workflowConditionPojo, WorkflowGetPojo workflowGetPojo) throws XbbException {
        String attrName = I18nMessageUtil.getMessage(I18nStringConstant.SPONSOR_DEPARTMENT);
        return getContent(workflowConditionPojo, workflowGetPojo, attrName);
    }
}
